package com.glela.platform.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import com.glela.platform.mapper.CUserPointTransactionMapper;
import com.glela.platform.model.CUserPointTransaction;
import com.glela.platform.service.CUserPointTransactionService;
import com.glela.platform.vo.ParamsUserXzbTransactionVo;
import com.glela.platform.vo.XzbTransactionUpdateVo;

@Service
public class CUserPointTransactionServiceImpl implements CUserPointTransactionService {
	@Autowired
	private CUserPointTransactionMapper cUserPointTransactionMapper;

	@Override
	public List<CUserPointTransaction> queryAll(ParamsUserXzbTransactionVo params_user_xzb_transaction) {
		return cUserPointTransactionMapper.selectByBussinessTypes(params_user_xzb_transaction);
	}

	@Override
	public boolean modify(List<XzbTransactionUpdateVo> updateXzbTransactionList) {
		if (CollectionUtils.isEmpty(updateXzbTransactionList)) {
			return false;
		}
		return cUserPointTransactionMapper.batchUpdateStatus(updateXzbTransactionList) == 1;
	}

	@Override
	public boolean insertSelective(CUserPointTransaction addCUserPointTransaction) {
		return cUserPointTransactionMapper.insertSelective(addCUserPointTransaction) == 1;
	}
}